package util;

import java.util.Comparator;

import model.Pricedata;



public class PricedataDateComparator implements Comparator<Pricedata> {
	int order = 0;

	public PricedataDateComparator(int order) {
		this.order = order;
	}

	public int compare(Pricedata pd1, Pricedata pd2) {
		if(pd1.getDate() < pd2.getDate()){
			return order;
		}
		else if (pd1.getDate() > pd2.getDate()) {
			return order*-1;
		}
		else return 0;
	}

	

}
